package com.zbkj.crmeb.merchant.api.service;

import com.common.CommonPage;
import com.zbkj.crmeb.chant.model.ChannelMerchant;
import com.zbkj.crmeb.front.response.PriceGroupResponse;
import com.zbkj.crmeb.marketing.dto.CouponProductRangeDTO;
import com.zbkj.crmeb.marketing.model.StoreCouponUser;
import com.zbkj.crmeb.marketing.request.FrontStoreCouponUserRequest;
import com.zbkj.crmeb.marketing.response.FrontStoreCouponUserResponse;
import com.zbkj.crmeb.marketing.response.StoreCouponUserResponse;
import com.zbkj.crmeb.store.response.StoreCartResponse;
import com.zbkj.crmeb.user.model.UserAddress;

import java.util.List;

public interface FrontCouponUserService {

    /**
     * 用户领取优惠券
     *
     * @param couponId 优惠券发布id
     * @return
     */
    boolean receiveFrontCouponUser(Integer couponId);

    /**
     * 我的优惠券列表
     *
     * @param pageParamRequest
     * @return
     */
    CommonPage<FrontStoreCouponUserResponse> listFrontCouponUsers(FrontStoreCouponUserRequest pageParamRequest);

    /**
     * 我的优惠券详情
     *
     * @param id 优惠券记录id
     * @return
     */
    FrontStoreCouponUserResponse getFrontCouponUserInfo(Integer id);

    /**
     * 统计用户可用优惠券数量
     *
     * @param userId 用户id
     * @return
     */
    Integer countFrontUsableCouponUser(Integer userId);

    /**
     * 查询优惠券品类券对象
     *
     * @param couponId 用户优惠券id
     */
    CouponProductRangeDTO getCouponProductRangeDTO(Integer couponId);

    /**
     * 定时任务-更新用户优惠券状态
     */
    void syncCouponUserStatus();

    /**
     * 获取详情
     * @param id
     * @return
     */
    StoreCouponUser getById(Integer id);

    /**
     * 获取指定商品id
     * @param couponId  优惠券发布id
     * @return
     */
    List<Integer> listCouponUserProductId(Integer couponId);

    /**
     * 查询购物车商品可用优惠券
     * @param storeCartResponse
     * @return
     */
    List<StoreCouponUserResponse> getCanUseUserCouponList(List<StoreCartResponse> storeCartResponse,
                                                          FrontStoreCouponUserRequest request,
                                                          boolean isFilter,
                                                          PriceGroupResponse priceGroupResponse,
                                                          UserAddress address,
                                                          ChannelMerchant channelMerchant);
}
